package com.edu.exam.enums.grading;

/**
 * 统计维度枚举
 */
public enum StatDimension {
    DAILY("DAILY", "每日"),
    WEEKLY("WEEKLY", "每周"),
    MONTHLY("MONTHLY", "每月"),
    QUARTERLY("QUARTERLY", "每季度"),
    YEARLY("YEARLY", "每年"),
    AUDITOR("AUDITOR", "审核人"),
    COURSE("COURSE", "课程"),
    TASK_TYPE("TASK_TYPE", "任务类型"),
    PRIORITY("PRIORITY", "优先级");

    private final String code;
    private final String description;

    StatDimension(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static StatDimension fromCode(String code) {
        for (StatDimension dimension : values()) {
            if (dimension.getCode().equals(code)) {
                return dimension;
            }
        }
        return DAILY; // 默认返回每日
    }
}